package org.osll.tictactoe.engine;

import java.io.Serializable;

import org.osll.tictactoe.Move;
import org.osll.tictactoe.Team;

public class MoveImpl implements Move,Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8465789355822207827L;

	public void setRow(int row) {
		this.row = row;
	}

	public void setCol(int col) {
		this.col = col;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof MoveImpl) {
			MoveImpl o = (MoveImpl)obj;
			return getCol()==o.getCol() && getRow()==o.getRow() && getTeam()==o.getTeam();
		}
		return false;
	}

	private int row;
	private int col;
	private Team team = Team.U;
	
	public MoveImpl( int row,int col, Team team) {
		this.col = col;
		this.row = row;
		this.team = team;
	}
	
	public MoveImpl() {
		
	}
	
	@Override
	public int getCol() {
		return col;
	}

	@Override
	public int getRow() {
		return row;
	}

	@Override
	public Team getTeam() {
		return team;
	}

}
